import request from '@/config/axios'

export interface OutboundDeliveryOrderVO {
  id: number
  outboundDeliveryNumber: string
  outboundDeliveryPerson: string
  outboundDeliveryTime: Date
  getMaterialsFormPerson: string
  creatorName: string
  updaterName: string
}

// 查询外协管理 -- 外协入/出库 -- 外协出库单列表
export const getOutboundDeliveryOrderPage = async (params) => {
  return await request.get({ url: `/outsource/outbound-delivery-order/page`, params })
}

// 查询外协管理 -- 外协入/出库 -- 外协出库单详情
export const getOutboundDeliveryOrder = async (id: number) => {
  return await request.get({ url: `/outsource/outbound-delivery-order/get?id=` + id })
}

// 新增外协管理 -- 外协入/出库 -- 外协出库单
export const createOutboundDeliveryOrder = async (data: OutboundDeliveryOrderVO) => {
  return await request.post({ url: `/outsource/outbound-delivery-order/create`, data })
}

// 修改外协管理 -- 外协入/出库 -- 外协出库单
export const updateOutboundDeliveryOrder = async (data: OutboundDeliveryOrderVO) => {
  return await request.put({ url: `/outsource/outbound-delivery-order/update`, data })
}

// 删除外协管理 -- 外协入/出库 -- 外协出库单
export const deleteOutboundDeliveryOrder = async (id: number) => {
  return await request.delete({ url: `/outsource/outbound-delivery-order/delete?id=` + id })
}

// 导出外协管理 -- 外协入/出库 -- 外协出库单 Excel
export const exportOutboundDeliveryOrder = async (data) => {
  return await request.download({ url: `/outsource/outbound-delivery-order/export-excel`, data })
}
